package com.glsc.ngateway.common.base.domain.mysql.gateway.system;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Getter
@Setter
@RequiredArgsConstructor
@Table(name = "t_gw_contact")
@org.hibernate.annotations.Table(appliesTo = "t_gw_contact",comment = "通用联系人信息表")
public class GwContact implements Serializable {

    @ApiModelProperty(value = "主键")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "int comment '主键'")
    private Integer id;

    @ApiModelProperty(value = "联系人类型")
    @Column(name = "contact_type", columnDefinition = "varchar(10) comment '联系人类型'")
    private String contactType;

    @ApiModelProperty(value = "联系人姓名")
    @Column(name = "contact_person", columnDefinition = "varchar(20) comment '联系人姓名'")
    private String contactPerson;

    @ApiModelProperty(value = "联系电话")
    @Column(name = "contact_phone", columnDefinition = "varchar(20) comment '联系电话'")
    private String contactPhone;

    @ApiModelProperty(value = "联系人手机")
    @Column(name = "contact_mobile", columnDefinition = "varchar(20) comment '联系人手机'")
    private String contactMobile;

    @ApiModelProperty(value = "联系人邮箱")
    @Column(name = "contact_email", columnDefinition = "varchar(50) comment '联系人邮箱'")
    private String contactEmail;

    @ApiModelProperty(value = "删除状态")
    @Column(name = "deleted", columnDefinition = "int(1) comment '删除状态'")
    private Integer deleted;

    @ApiModelProperty(value = "所属供应商id")
    @Transient
    private Integer vendorId;

    @ApiModelProperty(value = "所属供应姓名")
    @Transient
    private String vendorName;

    public GwContact(Integer id, String contactType, String contactPerson, String contactPhone, String contactMobile, String contactEmail, Integer deleted, Integer vendorId, String vendorName) {
        this.id = id;
        this.contactType = contactType;
        this.contactPerson = contactPerson;
        this.contactPhone = contactPhone;
        this.contactMobile = contactMobile;
        this.contactEmail = contactEmail;
        this.deleted = deleted;
        this.vendorId = vendorId;
        this.vendorName = vendorName;
    }
}
